package fr.oz.view.profile.dragable.ui 
{
	import caurina.transitions.Tweener;
	import flash.display.Sprite;
	import flash.filters.BitmapFilterQuality;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import fr.digitas.flowearth.text.styles.styleManager;
	/**
	 * ...
	 * @author Fazermokeur
	 */
	public class HourViewer extends Sprite
	{
		
		private var tf_hour:TextField;
		private var tf_hourold:TextField;
		private var tf_minut:TextField;
		private var tf_minutold:TextField;
		
		public function HourViewer() 
		{
			tf_hour = new TextField();
			tf_hourold = new TextField();
			tf_minut = new TextField();
			tf_minutold = new TextField();
			
			styleManager.applyFormat(tf_hour, ".profile_dragable_clock_view_hour");
			styleManager.applyFormat(tf_hourold, ".profile_dragable_clock_view_hour");
			styleManager.applyFormat(tf_minut, ".profile_dragable_clock_view_minut");
			styleManager.applyFormat(tf_minutold, ".profile_dragable_clock_view_minut");
			
			tf_hour.autoSize = TextFieldAutoSize.RIGHT;
			tf_hourold.autoSize = TextFieldAutoSize.RIGHT;
			
			addChild(tf_hour);
			addChild(tf_hourold);
			addChild(tf_minut);
			addChild(tf_minutold);
			
			tf_hour.x = -tf_hour.width;
			tf_hourold.x = -tf_hourold.width;
		}
		
		public function setHour(hour:String, minut:String):void
		{
			tf_minutold.text = tf_hour.text;
			tf_minutold.text = tf_minut.text;
			
			tf_hour.text = hour;
			tf_minut.text = minut;
			
			Tweener.addTween([tf_minutold, tf_hourold], { alpha:1 } );
			Tweener.addTween([tf_minutold, tf_hourold], { alpha:0, time:3 } );
			Tweener.addTween([tf_hour, tf_minut], { 	_Glow_quality : BitmapFilterQuality.HIGH,
											_Glow_color:0xffffff,
											_Glow_blurX:18,
											_Glow_blurY:18,
											_Glow_strength:3,
											_Glow_alpha:1,
											alpha : .5} );
											
			Tweener.addTween([tf_hour, tf_minut], { 	_Glow_quality : BitmapFilterQuality.HIGH,
											_Glow_color:0xffffff,
											_Glow_blurX:0,
											_Glow_blurY:0,
											_Glow_strength:0,
											_Glow_alpha:0,
											time:4,
											alpha:1} );
		}
		
	}

}